﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CardLib;

namespace CardClient.UnitTest
{
    class TestOperatorOfCard
    {
        public static void Test()
        {
            Random random = new Random();
            CardSuit randSuit;
            CardRank randRank;
            Card card1;
            Card card2;
            for (int i = 0; i < 50; i++)
            {
                randSuit = (CardSuit)random.Next(1, 6);
                randRank = (CardRank)random.Next(3, 18);
                card1 = new Card(randSuit, randRank, true);

                randSuit = (CardSuit)random.Next(1, 6);
                randRank = (CardRank)random.Next(3, 18);
                card2 = new Card(randSuit, randRank, true);

                Console.WriteLine("{0} == {1}, {2}", card1, card2, card1 == card2);
                Console.WriteLine("{0} != {1}, {2}", card1, card2, card1 != card2);
                Console.WriteLine("{0} > {1}, {2}", card1, card2, card1 > card2);
                Console.WriteLine("{0} < {1}, {2}", card1, card2, card1 < card2);
                Console.WriteLine("{0} >= {1}, {2}", card1, card2, card1 >= card2);
                Console.WriteLine("{0} <= {1}, {2}", card1, card2, card1 <= card2);
                Console.WriteLine("-------------------------------------");
            }

            Card card01 = new Card(CardSuit.Joker, CardRank.BlackJoker);
            Card card02 = new Card(CardSuit.Joker, CardRank.RedJoker);
            Console.WriteLine("{0} == {1}, {2}", card01, card02, card01 == card02);
            Console.WriteLine("{0} != {1}, {2}", card01, card02, card01 != card02);
            Console.WriteLine("{0} > {1}, {2}", card01, card02, card01 > card02);
            Console.WriteLine("{0} < {1}, {2}", card01, card02, card01 < card02);
            Console.WriteLine("{0} >= {1}, {2}", card01, card02, card01 >= card02);
            Console.WriteLine("{0} <= {1}, {2}", card01, card02, card01 <= card02);
        }
    }
}
